package org.example.partition;

import org.apache.flink.api.common.functions.Partitioner;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class PartitionCustom {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironment();

        env.setParallelism(2);


        DataStreamSource<String> localhost = env.socketTextStream("localhost", 8777);


//        localhost.partitionCustom(new Partitioner<String>() {
//            @Override
//            public int partition(String key, int numPartitions) {
//                return 0;
//            }
//        }, value -> {
//
//        });




        env.execute();
    }
}

